package com.sharejoys.eventdemo;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.Button;

/**
 * Created by chendx on 2018/2/23.
 */

public class MyButton extends Button {
    public MyButton(Context context) {
        super(context);
    }

    public MyButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        Log.i("chendx", "dispatchTouchEvent:action--"+event.getAction()+"-----"+"MyButton");
        return super.dispatchTouchEvent(event);
//		return false;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.i("chendx", "onTouchEvent:action--"+event.getAction()+"-----"+"MyButton");
         return  super.onTouchEvent(event);
//        return false;
    }
}
